<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width" />
<title>大转盘</title>
<style type="text/css">
#prizewheel_zone {
	width:500px;
	height:500px;
	margin:40px auto auto;
	position:relative;
	overflow:hidden;
}
#prizewheel {
	width:500px;
	height:500px;
}
</style>
<script type="text/javascript" src="js/prizewheel.js"></script>
</head>
<body>
<div id="prizewheel_zone">
  <div id="prizewheel"></div>
</div>
<script type="text/javascript">
	var awards = [	{	
						text:"会员网站\n50积分",
						src: "images/01.png"
					},
					{	
						text:"很抱歉\n您未能获奖",
						src: "images/02.png"
					},
					{	
						text:"会员网站\n300积分",
						src: "images/01.png"
					},
					{
						text:"《笑傲江湖OL》\n坐骑礼包",
						src: "images/03.png"
					},
					{	
						text:"会员网站\n200积分",
						src: "images/03.png"
					},
					{	
						text:"很抱歉\n您未能获奖",
						src: "images/02.png"
					},
					{	
						text:"会员网站\n100积分",
						src: "images/01.png"
					},
					{	
						text:"《笑傲江湖OL》\n技嘉礼包",
						src: "images/03.png"
					}];
	var prizeWheel = new PrizeWheel({
		diameter :500,
		containerId : "prizewheel",
		style:2,
		colors : ["#fff8c9", "#ffe484", "#fff484"],
		awards : awards,
		afterLottery:function(index){
			var award = awards[index];
			var message = award.text .replace(/\n/g, "");
			if(message.indexOf("很抱歉") == -1){
				message = "恭喜您，您抽中了" + message;
			}
			setTimeout(function(){
				alert(message);
			},3000);
		}
		
	});
</script>
</body>
</html>